<%@ page import="cn.NewsDao.NewsDao4" %>
<%@ page import="cn.NewsDaoImpl.NewsDaoImpl4" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/4/6
  Time: 12:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String newsid= request.getParameter("newsid");
    if (newsid!=null||newsid!=""){
        int newId = Integer.parseInt(newsid);
        NewsDao4 newsDao=new NewsDaoImpl4();
        boolean success=newsDao.delete(newId);
        if (success==true){
            response.sendRedirect(request.getContextPath()+"/news_user.jsp");
        }

    }else {
        System.out.println("删除失败");
    }
%>
</body>
</html>
